/**
 * 
 */
package org.osll.tictactoe.client.gui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.SystemColor;

import javax.swing.JLabel;
import javax.swing.JPanel;

public class StatusBar extends JPanel {
	
/**
 * 
 */
private final MainFrame StatusBar;

private JLabel label = new JLabel();

private JLabel info = new JLabel();

  public StatusBar(MainFrame mainFrame) {
    StatusBar = mainFrame;
	setLayout(new BorderLayout());
    setPreferredSize(new Dimension(10, 23));

    JPanel rightPanel = new JPanel(new BorderLayout());
    rightPanel.add(label, BorderLayout.SOUTH);
        rightPanel.setOpaque(false);

    add(rightPanel, BorderLayout.EAST);
    
    add(info, BorderLayout.WEST);
    
    setBackground(SystemColor.control);
  }

  protected void paintComponent(Graphics g) {
    super.paintComponent(g);

    int y = 0;
    g.setColor(new Color(156, 154, 140));
    g.drawLine(0, y, getWidth(), y);
    y++;
    g.setColor(new Color(196, 194, 183));
    g.drawLine(0, y, getWidth(), y);
    y++;
    g.setColor(new Color(218, 215, 201));
    g.drawLine(0, y, getWidth(), y);
    y++;
    g.setColor(new Color(233, 231, 217));
    g.drawLine(0, y, getWidth(), y);

    y = getHeight() - 3;
    g.setColor(new Color(233, 232, 218));
    g.drawLine(0, y, getWidth(), y);
    y++;
    g.setColor(new Color(233, 231, 216));
    g.drawLine(0, y, getWidth(), y);
    y = getHeight() - 1;
    g.setColor(new Color(221, 221, 220));
    g.drawLine(0, y, getWidth(), y);

  }

  void setText(String text) {
	  label.setText(text);
  }

  void setInfo(String text) {
	  info.setText(text);
  }
}